package main.java.challenges;

/**
 * @author hamldreza
 * A small frog wants to get to the other side of the road. 
 * The frog is currently located at position X and wants to get 
 * to a position greater than or equal to Y. The small frog always 
 * jumps a fixed distance, D.
 */
public class Frog {

	public static int solution(int X, int Y, int D) {
        // write your code in Java SE 6
		Y = Y - X;
		double d = (double) Y / D;
		double rr = Math.ceil(d);
		return (int) rr;
    }
}
